<include file="Public/min-header" />
<script type="text/javascript">
    window.UEDITOR_Admin_URL = "__ROOT__/Public/plugins/Ueditor/";
    var URL_upload = "{$URL_upload}";
    var URL_fileUp = "{$URL_fileUp}";
    var URL_scrawlUp = "{$URL_scrawlUp}";
    var URL_getRemoteImage = "{$URL_getRemoteImage}";
    var URL_imageManager = "{$URL_imageManager}";
    var URL_imageUp = "{$URL_imageUp}";
    var URL_getMovie = "{$URL_getMovie}";
    var URL_home = "{$URL_home}";    
</script>

<load href="__ROOT__/Public/plugins/Ueditor/ueditor.config.js"/>
<load href="__ROOT__/Public/plugins/Ueditor/ueditor.all.js"/>
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<div class="wrapper">
    
    <section class="content ">
        <!-- Main content -->
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回管理员列表"><i class="fa fa-reply"></i></a>
            	<!--<a href="javascript:;" class="btn btn-default" data-url="http://www.tp-shop.cn/Doc/Index/article/id/1001/developer/user.html" onclick="get_help(this)"><i class="fa fa-question-circle"></i> 帮助</a>-->
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                   
                </div>
                <div class="panel-body ">   
                    <!--表单数据-->
                    <!--<form method="post" id="adminHandle" action="__SELF__" enctype="multipart/form-data">         -->           
                    <form method="post" id="adminHandle" action="{:U('Admin/Article/service_content_save',array(id =>$info[id]))}" enctype="multipart/form-data">         
                        <!--通用信息-->
                    <div class="tab-content col-md-10">                 	  
                        <div class="tab-pane active" id="tab_tongyong">                           
                            <table class="table table-bordered">
                                <tbody>
                                <tr>
                                    <td class="col-sm-2">加工类型：</td>
                                    <td class="col-sm-8">
                                        <input type="text" class="form-control" name="company_name" value="{$info.type}" >
                                                                      
                                    </td>
                                </tr>  
                                
                                <tr>
                                    <td class="col-sm-2">简介：</td>
                                    <td class="col-sm-8">
                                        <input type="text" class="form-control" name="company_introduce" value="{$info[type_describe]}" >
                                                                      
                                    </td>
                                </tr>
                                <tr>
                                    <td class="col-sm-2">微企图片：</td>
                                    <td id="photo_box" class="col-sm-8">
                                    	<if condition="!empty($info)">
											<img src="{$info[img]}" width="100%"/>
											<br />
											<button id="change_photo" class="btn btn-warning pull-right">更改图片</button>
										<else /	>
											<input type='file' name='company_photo' />
										</if>
                                    </td>
                                </tr>
                                    <tr>
                                    <td class="col-sm-2">二级页面详细介绍</td>
                                     <td class="col-sm-8">
                                         <textarea class="span12 ckeditor" id="post_content" name="contents" title="">
                            {$info.content}
                        </textarea>
                                                                      
                                    </td>
                                </tr                             
                                </tbody> 
                                <tfoot>
                                	<tr>
                                		<td></td>
                                		<td class="text-right"><input class="btn btn-primary" type="button" onclick="adsubmit()" value="提交"></td>
                                	</tr>
                                </tfoot>                               
                                </table>
                        </div>                           
                    </div>              
			    	</form><!--表单数据-->
                </div>
            </div>
        </div>
    </section>
</div>
<script>

var editor;
    $(function () {
        //具体参数配置在  editor_config.js 中
        var options = {
            zIndex: 999,
            initialFrameWidth: "100%", //初化宽度
            initialFrameHeight: 400, //初化高度
            focus: false, //初始化时，是否让编辑器获得焦点true或false
            maximumWords: 99999, removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign',//允许的最大字符数 'fullscreen',
            pasteplain:false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴，true为使用纯文本粘贴
            autoHeightEnabled: true
         /*   autotypeset: {
                mergeEmptyline: true,        //合并空行
                removeClass: true,           //去掉冗余的class
                removeEmptyline: false,      //去掉空行
                textAlign: "left",           //段落的排版方式，可以是 left,right,center,justify 去掉这个属性表示不执行排版
                imageBlockLine: 'center',    //图片的浮动方式，独占一行剧中,左右浮动，默认: center,left,right,none 去掉这个属性表示不执行排版
                pasteFilter: false,          //根据规则过滤没事粘贴进来的内容
                clearFontSize: false,        //去掉所有的内嵌字号，使用编辑器默认的字号
                clearFontFamily: false,      //去掉所有的内嵌字体，使用编辑器默认的字体
                removeEmptyNode: false,      //去掉空节点
                                             //可以去掉的标签
                removeTagNames: {"font": 1},
                indent: false,               // 行首缩进
                indentValue: '0em'           //行首缩进的大小
            }*/
        };
        editor = new UE.ui.Editor(options);
        editor.render("post_content","post_content1");

        editor_two = new UE.ui.Editor(options);
        editor_two.render("post_content_two");
    });  
    
    
    $('#publish_time').daterangepicker({
        format:"YYYY-MM-DD",
        singleDatePicker: true,
        showDropdowns: true,
        minDate:'2016-01-01',
        maxDate:'2030-01-01',
        startDate:'{$info.publish_time|date="Y-m-d",###}',
        locale : {
            applyLabel : '确定',
            cancelLabel : '取消',
            fromLabel : '起始时间',
            toLabel : '结束时间',
            customRangeLabel : '自定义',
            daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
            monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月','七月', '八月', '九月', '十月', '十一月', '十二月' ],
            firstDay : 1
        }
    });


function adsubmit(){
	$('#adminHandle').submit();
}
$('#change_photo').on('click',function(event){
	event.preventDefault();
	$('#photo_box').html(
		"<input type='file' name='company_photo' />"
	);
})
</script>
</body>
</html>